package com.buddha.api.mapper;

import com.buddha.api.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author mybatis-plus
 * @since 2023-07-06
 */
@Repository
public interface UserMapper extends BaseMapper<User> {

    @Select("select distinct(m_id) from user_role left join role_menu on user_role.r_id = role_menu.r_id where u_id=#{userId}")
    List<Long> selectMenuIds(long userId);


    List<String> userNameByMenuId(long menuId);
}
